1. Field of the Invention
The present invention relates to a communication device and a distance calculation system.
2. Description of the Related Art
In these years, among communication devices that communicate with each other to perform prescribed processing are, for example, vehicle-mounted and mobile devices for vehicles having a passive keyless entry system mounted therein.
Communications between the vehicle-mounted and mobile devices for vehicles having a passive keyless entry system mounted therein will be described below in detail. It is supposed that the vehicle-mounted device is installed, e.g., in the driver side door of a vehicle and that the owner of the vehicle (hereinafter called a wearer) has the mobile device with him. Further, it is supposed that the wearer has stopped the engine of the vehicle, opened the door, and left the vehicle.
The vehicle-mounted device transmits a signal (hereinafter called a signal A) to determine whether the mobile device is within a range (area) in which the vehicle-mounted device and the mobile device can communicate. When the wearer is within the communication-feasible range, the mobile device receives the signal A from the vehicle-mounted device, and transmits a signal B in response to the signal A. When receiving the signal B from the mobile device, the vehicle-mounted device determines that the mobile device is within the communication-feasible range. The transmission of the signal A from the vehicle-mounted device is repeated at predetermined intervals.
If the wearer goes outside the communication-feasible range, the mobile device cannot receive the signal A from the vehicle-mounted device. Hence, the vehicle-mounted device gets to not receive the signal B from the mobile device in response to the signal A. For example, when not receiving the signal B from the mobile device for a predetermined time period, the vehicle-mounted device sends an instruction signal to lock the doors of the vehicle to a controller provided separately in the vehicle. The controller locks the doors of the vehicle according to the instruction signal. Thus, when the wearer leaves the vehicle and goes outside the communication-feasible range, the doors of the vehicle are locked.
Next, when the wearer, who was out of the communication-feasible range, has got back into the communication-feasible range, the mobile device receives the signal A from the vehicle-mounted device, and transmits the signal B. When receiving the signal B from the mobile device, the vehicle-mounted device transmits a read signal to read out information of the mobile device to determine whether the mobile device is corresponding to the vehicle. If determining that the mobile device is corresponding to the vehicle, the vehicle-mounted device sends an instruction signal to unlock the doors of the vehicle to the controller. The controller unlocks the doors of the vehicle according to the instruction signal.
In this way, in the vehicle having the passive keyless entry system mounted, it is possible that the doors of the vehicle are locked and unlocked through communications between the vehicle-mounted device and the mobile device without inserting a vehicle key into the key hole. See for example Japanese Patent Application Laid-Open Publication No. 2000-198420.
However, with vehicles having the passive keyless entry system mounted, when a so-called relay attack is made in the above-described communications between the vehicle-mounted device and the mobile device, there is a possibility that the vehicle may be stolen. This relay attack refers to a kind of theft wherein in the state where, the wearer being out of the communication-feasible range, the vehicle-mounted device and the mobile device otherwise could not communicate, by using a relay the vehicle-mounted device and the mobile device are made to be able to communicate, thereby unlocking the doors of the vehicle to allow the vehicle to be stolen.
The relay attack will be described below in detail using FIG. 12. FIG. 12 is a diagram showing communications between a vehicle-mounted device 101 and a mobile device 102 via relays A and B. The vehicle-mounted device 101 is installed, e.g., in the driver side door and transmits the signal A. The vehicle-mounted device 101 can transmit and receive signals within a communication range denoted by a broken line C. When receiving the signal A from the vehicle-mounted device 101, the mobile device 102 transmits the signal B in response to the signal A as described above. Note that the mobile device 102 can transmit and receive signals within a communication range denoted by a broken line D.
If the wearer goes outside the communication-feasible range, the signal B in response to the signal A is not transmitted from the mobile device 102 to the vehicle-mounted device 101 and a controller (not shown) locks the doors according to an instruction signal from the vehicle-mounted device 101 as described above.
Here, suppose that there are intermediaries X and Y intending to steal the vehicle, the intermediary X carrying the relay A enters the communication range C of the vehicle-mounted device 101. And the intermediary Y carrying the relay B comes close to the wearer, with having the relay B enter the communication range D of the mobile device 102. The relay A being carried by the intermediary X receives the signal A since being within the communication range C, and detects and amplifies the signal A, and transmits the amplified signal A. Since amplifying the signal A, the relay A can transmit the signal A over a broader range than the communication range C of the vehicle-mounted device 101. When receiving the signal A amplified by the relay A, the relay B being carried by the intermediary Y detects the amplified signal A and attenuates the signal A to, e.g., the level before amplified by the relay A and transmits the attenuated signal A. Here, since the relay B is within the communication range D of the mobile device 102, the mobile device 102 receives the signal A attenuated by the relay B. Considering that the signal A from the vehicle-mounted device 101 has been received, the mobile device 102 transmits the signal B in response to the signal A. When receiving the signal B, the relay B detects, and amplifies the signal B and transmits the amplified signal B. Since amplifying the signal B, the relay B can transmit the signal B over a broader range than the communication range D of the mobile device 102. When receiving the signal B amplified by the relay B, the relay A detects the amplified signal B and attenuates the signal B to, e.g., the level before amplified by the relay B and transmits the attenuated signal B. Here, since the relay A is within the communication range C of the vehicle-mounted device 101, the vehicle-mounted device 101 receives the signal B attenuated by the relay A. Since receiving the signal B in response to the signal A, the vehicle-mounted device 101 determines that the mobile device 102 is within the communication-feasible range. Then, the vehicle-mounted device 101 performs the previously described process to unlock the doors of the vehicle. Thus, for example, the intermediary X gets in the unlocked vehicle and steals the vehicle.
With communications between the vehicle-mounted device 101 and the mobile device 102 via relays A and B, the signal B is received via relays A and B and then the vehicle-mounted device 101 may determine that the mobile device 102 is within the communication-feasible range. Thus, the vehicle-mounted device 101 may send the instruction signal to unlock the doors of the vehicle to the controller, thus unlocking the doors by the controller, although the wearer is not within the communication-feasible range.